<template>
  <div class="body_center">
    <el-breadcrumb style="margin-top: 30px" separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>职业培训</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="main_content">
      <div class="main_left">
        <ul>
          <li
            :class="index == activeIndex ? 'active' : 'main_left_li'"
            @click="handleSelect(index)"
            v-for="(item, index) in majorList"
            :key="index"
          >
            {{ item.name }}
          </li>
        </ul>
      </div>
      <div class="main_right">
        <h3 class="main_right_title">{{ majorList[activeIndex].name }}</h3>
        <div class="main_right_tag" v-if="majorList[activeIndex].pxgw">
          {{ majorList[activeIndex].pxgw }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].bmtj">
          {{ majorList[activeIndex].bmtj }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].pxlc">
          {{ majorList[activeIndex].pxlc }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].pxzq">
          {{ majorList[activeIndex].pxzq }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].jxjy">
          {{ majorList[activeIndex].jxjy }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].qzzq">
          {{ majorList[activeIndex].qzzq }}
        </div>
        <div class="main_right_tag" v-if="majorList[activeIndex].zsgt">
          {{ majorList[activeIndex].zsgt }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "0",
      majorList: [
        {
          name: "建筑安管人员（ABC证）新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          pxzq: "培训周期",
          jxjy: "继续教育",
        },
        {
          name: "建筑特种工新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          pxzq: "培训周期",
          jxjy: "继续教育",
        },
        {
          name: "建筑七大员新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          pxzq: "培训周期",
          jxjy: "继续教育",
          zsgt: "证书更替",
        },
        {
          name: "建筑技能工新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          pxzq: "培训周期",
        },
        {
          name: "水利安管人员（ABC证）新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          qzzq: "取证周期",
          jxjy: "继续教育",
        },
        {
          name: "水利五大员新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          qzzq: "取证周期",
        },
        {
          name: "公路安管人员（ABC证）新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          qzzq: "取证周期",
          jxjy: "继续教育",
        },
        {
          name: "公路施工员、公路养护工新考",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          qzzq: "取证周期",
        },
        {
          name: "安监特种工新考及继教",
          pxgw: "培训岗位",
          bmtj: "报名条件",
          pxlc: "培训流程",
          qzzq: "取证周期",
          jxjy: "继续教育",
        },
        {
          name: "其他建设行业证书新考及继教",
        },
      ],
    };
  },
  created() {
    this.activeIndex = this.$route.query.activeIndex;
  },
  methods: {
    handleSelect(index) {
      this.activeIndex = index;
    },
  },
};
</script>

<style scoped>
.main_right_tag {
  width: 745px;
  height: 42px;
  border-left: 4px solid #2590f4;
  background-color: #f9fafb;
  color: #2590F4;
  line-height: 42px;
  text-indent: 22px;
}
.main_right_title {
  font-weight: blod;
  font-size: 22px;
  text-align: center;
  margin-top: 46px;
  margin-bottom: 80px;
  color: #333333;
}
.body_center {
  width: 1200px;
  margin: auto;
}
.main_content {
  margin-top: 30px;
  display: inline-block;
}
.main_left {
  width: 271px;
  background-color: #fff;
  float: left;
}
.main_right {
  width: 909px;
  height: 1000px;
  background-color: #fff;
  float: left;
  margin-left: 20px;
}
.main_left_li {
  width: 267px;
  height: 57px;
  background-color: #fff;
  border-left: 4px solid #fff;
  text-align: center;
  line-height: 57px;
  font-size: 14px;
  color: #666666;
  background-color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active {
  width: 267px;
  height: 57px;
  background-color: #fff;
  border-left: 4px solid #2590f4;
  text-align: center;
  line-height: 57px;
  font-size: 14px;
  color: #2590f4;
  background-color: #e7f0f8;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>